package com.example.domain.entity;

import javax.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 单品折扣规则实体类
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "item_discount_rules")
public class ItemDiscountRule extends SoftDeleteEntity {

    @Id
    @Column(name = "id", length = 26)
    private String id;

    @Column(name = "rule_id", length = 26, nullable = false)
    private String ruleId;

    @Column(name = "product_id", length = 26, nullable = false)
    private String productId;

    @Column(name = "discount_rate", precision = 8, scale = 6, nullable = false)
    private BigDecimal discountRate;
}

